package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.EnterpriseUserDao;
import com.internship.model.EnterpriseUser;
import com.internship.page.Page;

@Service
public class EnterpriseUserService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private EnterpriseUserDao enterpriseUserDao;

	public EnterpriseUser getEnterpriseuser(String UserAccount) {
		return enterpriseUserDao.getEnterpriseuser(UserAccount);
	}
	public Page<EnterpriseUser> getEnterpriseuserList(int EnterpriseId, String UserName,int pageNumber) {
		Page<EnterpriseUser> page = new Page<EnterpriseUser>(pageNumber, PAGE_SIZE);
		List<EnterpriseUser> list = enterpriseUserDao.getEnterpriseuserList(EnterpriseId, UserName, page);
		page.setResultList(list);
		return page;
	}
	public List<EnterpriseUser> getEnterpriseuserList() {
		List<EnterpriseUser> list = enterpriseUserDao.getEnterpriseuserList();
		return list;
	}
	public int addEnterpriseuser(EnterpriseUser enterpriseuser) {
		return enterpriseUserDao.addEnterpriseuser(enterpriseuser);
	}
	public int updateEnterpriseinfo(EnterpriseUser enterpriseuser) {
		return enterpriseUserDao.updateEnterpriseuser(enterpriseuser);
	}
	public int delEnterpriseinfo(String UserAccount) {
		return enterpriseUserDao.delEnterpriseuser(UserAccount);
		}
	public int delAll(String[] ids) {
		return enterpriseUserDao.delAll(ids);
	}
	public List<EnterpriseUser> getDistributionEnterpriseuserList(int EnterpriseId) {
		List<EnterpriseUser> list = enterpriseUserDao.getDistributionEnterpriseuserList(EnterpriseId);
		return list;
	}
}
